<html>
<head><meta charset="utf-8"><title>placeholder loans vs subsets · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html">placeholder loans vs subsets</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205801916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205801916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205801916">(Aug 03 2020 at 14:42)</a>:</h4>
<p>this is mostly an implementation detail in my mind</p>



<a name="205801947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205801947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205801947">(Aug 03 2020 at 14:42)</a>:</h4>
<p>I agree but it's worth trying to settle it</p>



<a name="205801981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205801981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205801981">(Aug 03 2020 at 14:42)</a>:</h4>
<p>I'd also be curious to hear from <span class="user-mention" data-user-id="127262">@Aaron Weiss</span> a bit more about the oxide side of things, but maybe he's not able to communicate much at present</p>



<a name="205802061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205802061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205802061">(Aug 03 2020 at 14:43)</a>:</h4>
<p>oh of course it's worth doing so, I didn't mean to imply the opposite sorry</p>



<a name="205804182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205804182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205804182">(Aug 03 2020 at 15:00)</a>:</h4>
<p>So, if I recall correctly, this is ultimately a question of how to address relationships between quantified provenances/lifetimes, right?</p>



<a name="205804539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205804539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205804539">(Aug 03 2020 at 15:02)</a>:</h4>
<p>Or well, between the local kind and the quantified kind.</p>



<a name="205804948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205804948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205804948">(Aug 03 2020 at 15:04)</a>:</h4>
<p>If so, I think we probably have deviated somewhat from Polonius in this area, but what we do is closer to subsets. In particular, we don’t associate any sets directly with quantified provenances, and we relate local and qualified provenances only when the former’s loan sets consist of reborrows from qualified provenances that outlive the qualified provenance in question.</p>



<a name="205804969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205804969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205804969">(Aug 03 2020 at 15:04)</a>:</h4>
<p>right</p>



<a name="205805110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805110">(Aug 03 2020 at 15:05)</a>:</h4>
<p>in my original formulation <a href="http://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/">I wrote in this blog post</a>, we basically looked at the set of "required subset relations" between origins/regions and reported errors if those exceeded what the where clause permitted</p>



<a name="205805172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805172">(Aug 03 2020 at 15:06)</a>:</h4>
<p>but then we switched to having "placeholder loans"</p>



<a name="205805210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805210">(Aug 03 2020 at 15:06)</a>:</h4>
<p>it's very, very similar, it's maybe a bit messier, but it has the advantage that you can always replace an origin with a set of loans</p>



<a name="205805253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805253">(Aug 03 2020 at 15:06)</a>:</h4>
<p>I think "provenance = origin"</p>



<a name="205805330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805330">(Aug 03 2020 at 15:07)</a>:</h4>
<div class="codehilite"><pre><span></span><code>subset_error(R1, R2, P) :-
  subset(R1, R2, P),      // `R1: R2` required at `P`
  placeholder_region(R1), // `R1` is a placeholder
  placeholder_region(R2), // `R2` is also a placeholder
  !known_subset(R1, R2).  // `R1: R2` is not a &quot;known subset&quot; relation.
</code></pre></div>



<a name="205805339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805339">(Aug 03 2020 at 15:07)</a>:</h4>
<p>that's from the blog post, it was kind of the key rule</p>



<a name="205805431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805431">(Aug 03 2020 at 15:07)</a>:</h4>
<p>I guess I'm open to either formulation, I did like being able to replace origins with "sets of loans" entirely</p>



<a name="205805484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805484">(Aug 03 2020 at 15:08)</a>:</h4>
<p>but I think it's mostly a conceptual thing</p>



<a name="205805516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205805516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205805516">(Aug 03 2020 at 15:08)</a>:</h4>
<p>still it made it more obviously equivalent to some of the formalisms I've seen proposd</p>



<a name="205806089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205806089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205806089">(Aug 03 2020 at 15:13)</a>:</h4>
<p>Yeah, so I think that what we’re doing is more or less looking at the required subset relations. In our setting, it’s a subtyping-style constraint, but checking the relation on a local and qualified provenance has us basically drudge up whatever qualified provenances the local one was reborrowed from (using loans that contain a dereference which I’ve been calling “reborrow loans”) and check that the relation holds from the where bounds.</p>



<a name="205806327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205806327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205806327">(Aug 03 2020 at 15:14)</a>:</h4>
<p>I don’t know that we really had a good reason for doing one or the other except that the path through the design space I took ended up with these reborrow loans and this style of solution seemed most apparent to me at the time. Maybe just because of distance from when we discussed placeholders.</p>



<a name="205806800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205806800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205806800">(Aug 03 2020 at 15:17)</a>:</h4>
<p>I do think the idea of being able to replace origins with sets of loans is a nice one because it gives a clear sense of what an origin “means.”</p>



<a name="205807177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807177">(Aug 03 2020 at 15:20)</a>:</h4>
<p>Right</p>



<a name="205807207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807207">(Aug 03 2020 at 15:20)</a>:</h4>
<p>That was my main concern, that otherwise it was like "an origin is a set of loans, but also it has an identity of its own"</p>



<a name="205807239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807239">(Aug 03 2020 at 15:21)</a>:</h4>
<p><em>that said</em></p>



<a name="205807268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807268">(Aug 03 2020 at 15:21)</a>:</h4>
<p>Yeah, that’s more-or-less what they are in Oxide right now. The identity matters for at least a few pieces of our system.</p>



<a name="205807270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807270">(Aug 03 2020 at 15:21)</a>:</h4>
<p>origins always have something of a persistent identity</p>



<a name="205807312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807312">(Aug 03 2020 at 15:21)</a>:</h4>
<p>i.e., in today's formulation, we track the subsets which must hold between origins -- and those "flow forward" and must be maintained in later bits of the CFG</p>



<a name="205807320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807320">(Aug 03 2020 at 15:21)</a>:</h4>
<p>in the equality variant, the same is true, but just less commonly</p>



<a name="205807374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807374">(Aug 03 2020 at 15:22)</a>:</h4>
<p>so it's not like you could ever <em>truly</em> erase the origins I guess</p>



<a name="205807407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807407">(Aug 03 2020 at 15:22)</a>:</h4>
<p>In the sense that you need to know which ones flow forward and which ones don’t?</p>



<a name="205807427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807427">(Aug 03 2020 at 15:22)</a>:</h4>
<p>my memory of oxide is dated</p>



<a name="205807436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807436">(Aug 03 2020 at 15:22)</a>:</h4>
<p>but what I remember from there was that</p>



<a name="205807451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807451">(Aug 03 2020 at 15:23)</a>:</h4>
<p>in invariant contexts, you would have to have <em>the same origin</em> in the type</p>



<a name="205807541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807541">(Aug 03 2020 at 15:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="127262">Aaron Weiss</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/placeholder.20loans.20vs.20subsets/near/205807407">said</a>:</p>
<blockquote>
<p>In the sense that you need to know which ones flow forward and which ones don’t?</p>
</blockquote>
<p>right in the sense that you have to remember which origins must remain equal to one another because they got "entangled" b some previous bit of code</p>



<a name="205807620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807620">(Aug 03 2020 at 15:24)</a>:</h4>
<p>this is basically our way of encoding the flow-sensitive type system..</p>



<a name="205807638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807638">(Aug 03 2020 at 15:24)</a>:</h4>
<p><a href="https://github.com/rust-lang/polonius/issues/107">examples and some related discussion</a></p>



<a name="205807658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807658">(Aug 03 2020 at 15:24)</a>:</h4>
<p>this is the key example</p>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">v</span>: <span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;v</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">p</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;p</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"></span>
<span class="n">p</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="o">..</span><span class="p">.);</span><span class="w"> </span><span class="c1">// any changes to &#39;p here *should* affect &#39;v</span>
</code></pre></div>



<a name="205807678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807678">(Aug 03 2020 at 15:24)</a>:</h4>
<p>here, <code>'v</code> and <code>'p</code> are not independent</p>



<a name="205807717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807717">(Aug 03 2020 at 15:24)</a>:</h4>
<p>my recollection is that oxide would've required that the user write <code>'v</code> in <code>p</code></p>



<a name="205807743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807743">(Aug 03 2020 at 15:25)</a>:</h4>
<p>re: invariant contexts, If that wasn’t true in the past, it’s true now because we actually have an ordering on our environments and we require provenances to occur earlier in the environment in order to outlive another. So, invariance would require that to be true in both directions meaning it would have to be exactly the same.</p>



<a name="205807744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205807744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205807744">(Aug 03 2020 at 15:25)</a>:</h4>
<p>(and indeed we formulated a variant like that, but then found that it was too flow insensitive to accept <a href="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026">this example</a>)</p>



<a name="205808112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205808112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205808112">(Aug 03 2020 at 15:28)</a>:</h4>
<p>So, what you’re doing is essentially allowing them the different names, but recording that ‘v and ‘p are equal?</p>



<a name="205808278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205808278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205808278">(Aug 03 2020 at 15:29)</a>:</h4>
<p>correct</p>



<a name="205808373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205808373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205808373">(Aug 03 2020 at 15:30)</a>:</h4>
<p>the interesting part about <em>that</em> is that this equality can be flow-sensitive</p>



<a name="205808413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205808413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205808413">(Aug 03 2020 at 15:30)</a>:</h4>
<p>(the same is true in our code today, except that we are not recording <em>equality</em> but <code>p &lt;= q</code> relations)</p>



<a name="205808949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205808949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205808949">(Aug 03 2020 at 15:34)</a>:</h4>
<p>I think Oxide in its current form would reject the example you just linked for essentially the same reason the flow-insensitive equality would.</p>



<a name="205809312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205809312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205809312">(Aug 03 2020 at 15:37)</a>:</h4>
<p>The fact that the identity of origins does matter then makes the argument for placeholder loans less compelling to me personally.</p>



<a name="205809454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205809454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205809454">(Aug 03 2020 at 15:38)</a>:</h4>
<p>Since it does really mean that an origin is always a set of loans with a unique identity plus context-dependent constraints on the relationship between those identities.</p>



<a name="205809736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205809736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205809736">(Aug 03 2020 at 15:41)</a>:</h4>
<p>(I myself was mostly assuming the theoretical aspect would be relatively similar between the 2 but didn't think about the impact on the Equality variant or invariance; on the operational side, placeholder loans mesh well with location insensitivity, but not with trying to limit the propagation of subsets; I like the neatness of the model using placeholder loans, and origins as set of loans, but at the same time I see loan propagation as just materializing the fact that two origins were once reachable via space/subsets and time/cfg -- and hoped we could sometimes avoid materializing them altogether)</p>



<a name="205813311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205813311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205813311">(Aug 03 2020 at 16:09)</a>:</h4>
<p>ack, I think I have the other topics in this stream not visible</p>



<a name="205813395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205813395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205813395">(Aug 03 2020 at 16:10)</a>:</h4>
<p>so I think I persuaded myself that we don't need to do everything via placeholders</p>



<a name="205813406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205813406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205813406">(Aug 03 2020 at 16:10)</a>:</h4>
<p>for the reason that we <em>still</em> can't just replace origins with sets of loans</p>



<a name="205813459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205813459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205813459">(Aug 03 2020 at 16:11)</a>:</h4>
<p>so really you can't think of the polonius rules that way, or at least, it's a non-trivial change to achieve it</p>



<a name="205814084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814084">(Aug 03 2020 at 16:16)</a>:</h4>
<p>should we <span class="user-mention" data-user-id="116113">@lqd</span> adjust the hackmd rules to match and try to make polonius match then?</p>



<a name="205814339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814339">(Aug 03 2020 at 16:18)</a>:</h4>
<p>modify the rules to compute subset errors via rules about subsets ?</p>



<a name="205814625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814625">(Aug 03 2020 at 16:21)</a>:</h4>
<p>yeah I mean it's a pretty small modification I guess</p>



<a name="205814632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814632">(Aug 03 2020 at 16:21)</a>:</h4>
<p>I'll start gathering those</p>



<a name="205814650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814650">(Aug 03 2020 at 16:21)</a>:</h4>
<p>I'll do it</p>



<a name="205814681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205814681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205814681">(Aug 03 2020 at 16:22)</a>:</h4>
<p>so you can focus on more important things</p>



<a name="205815027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815027">(Aug 03 2020 at 16:24)</a>:</h4>
<p>I guess I could also add the location-insensitive rules to the hackmd at the same time (as it can still use placeholder loans very naturally anyways)</p>



<a name="205815445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815445">(Aug 03 2020 at 16:28)</a>:</h4>
<p>which rules do you mean?</p>



<a name="205815467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815467">(Aug 03 2020 at 16:28)</a>:</h4>
<p>but that sounds useful</p>



<a name="205815500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815500">(Aug 03 2020 at 16:29)</a>:</h4>
<p>the simple rules used by the location-insensitive analysis</p>



<a name="205815645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815645">(Aug 03 2020 at 16:30)</a>:</h4>
<p>how do they rely on placeholder loans?</p>



<a name="205815716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205815716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205815716">(Aug 03 2020 at 16:30)</a>:</h4>
<p>they don't yet, but in order to still have a fast pre-pass we can "potential subset errors" to the location-insensitive analysis</p>



<a name="205816047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816047">(Aug 03 2020 at 16:33)</a>:</h4>
<p>(it probably wouldn't be complicated to add the subset-errors via subset rules, but for placeholder loans I think it was literally a single character change)</p>



<a name="205816051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816051">(Aug 03 2020 at 16:33)</a>:</h4>
<p>right, so, the location insensitive analysis computes <code>SUBSET(OriginA, OriginB)</code> across the whole CFG, right?</p>



<a name="205816119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816119">(Aug 03 2020 at 16:34)</a>:</h4>
<p>so presumably we could determine whether any placeholders wind up that set?</p>



<a name="205816140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816140">(Aug 03 2020 at 16:34)</a>:</h4>
<p>er, I mean, whether any "placeholder origins" wind up in that set</p>



<a name="205816165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816165">(Aug 03 2020 at 16:34)</a>:</h4>
<p>I guess it's not clear how that would help us maybe</p>



<a name="205816566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816566">(Aug 03 2020 at 16:37)</a>:</h4>
<p>yes that's what the the analysis does and indeed just checking whether a placeholder loan ends up in there was easy</p>



<a name="205816763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816763">(Aug 03 2020 at 16:39)</a>:</h4>
<p>I guess though that if we adopt the "subset relation" approach to reporting errors, well, I suppose it can still be useful</p>



<a name="205816782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816782">(Aug 03 2020 at 16:39)</a>:</h4>
<p>I was thinking that it wouldn't obviously help in allowing us to avoid computation but</p>



<a name="205816814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816814">(Aug 03 2020 at 16:39)</a>:</h4>
<p>it doesn't help us that much more than the regular subset-rules subset errors but it mapped naturally to this existing relation, compared to having more relations; it was mostly cute that a single character was enough to make the placeholder loan computation location-insensitive</p>



<a name="205816825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205816825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205816825">(Aug 03 2020 at 16:39)</a>:</h4>
<p>at least the <code>subset_error</code> can only iterate over placeholder origins that may be involved in errors</p>



<a name="205817016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205817016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205817016">(Aug 03 2020 at 16:40)</a>:</h4>
<p>(also the <code>outlives_everywhere</code> idea to fix the OOM mapped naturally to the location-insensitive analysis)</p>



<a name="205817108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205817108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205817108">(Aug 03 2020 at 16:41)</a>:</h4>
<p>my recollection is that these potential loan errors and potential subset errors do allow for a lot of filtering in the regular location-sensitive analyses</p>



<a name="205821567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205821567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205821567">(Aug 03 2020 at 17:17)</a>:</h4>
<p>the real win would be if we can compute fewer subset relations</p>



<a name="205821576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205821576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205821576">(Aug 03 2020 at 17:17)</a>:</h4>
<p>(at least in this specific case)</p>



<a name="205828605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205828605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205828605">(Aug 03 2020 at 18:18)</a>:</h4>
<p>that's also interesting as splitting subset errors from placeholder loans can allow to filter the data independently with the results of the pre-pass</p>



<a name="205829076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/placeholder%20loans%20vs%20subsets/near/205829076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/placeholder.20loans.20vs.20subsets.html#205829076">(Aug 03 2020 at 18:22)</a>:</h4>
<p>I recall that when we heavily filtered the outlives relation to remove all the subsets which couldn't easily reach an error, it had quite an impact on clap, and that's the kind of things we can't easily do when both are intertwined</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>